<?php
namespace app\model;
use think\Model;
use think\model\concern\SoftDelete;
class WxGroup extends Model{
    use SoftDelete;
    protected $deleteTime = 'delete_time';

    // 群列表
    public function get_list(){
        $list = $this->alias('wx')
        ->field('wx.*,u.username media_name')
        ->join('user u','u.id = wx.media_id','LEFT')
        ->select();
        foreach ($list as $k=>$v){
            $w[] = ['id','in',$v['channel_ids']];
            $name_list = Channel::where($w)->column('name');
            $list[$k]['channel_names'] = implode(',',$name_list);

        }
        return $list;
    }

    



















}